import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '年级',
    align:"center",
    dataIndex: 'gradeName'
   },
   {
    title: '班级',
    align:"center",
    dataIndex: 'className'
   },
   {
    title: '学生姓名',
    align:"center",
    dataIndex: 'studentName'
   },
   {
    title: '学生手机号',
    align:"center",
    dataIndex: 'phone'
   },
   {
    title: '设备IMEI',
    align:"center",
    dataIndex: 'imei'
   },
   /*
   {
    title: '报警类型',
    align:"center",
    dataIndex: 'alarmType',
    slots: { customRender: 'alarmTypeSlot' }
   },*/
   {
    title: '报警名称',
    align:"center",
    dataIndex: 'alarmName'
   },
    /*
   {
    title: '处理结果',
    align:"center",
    dataIndex: 'result',
    slots: { customRender: 'resultSlot' }
   
    customRender:({text}) =>{
      return !text?"":(text=='0'?"未处理":"已处理")
    },
   },*/
   {
    title: '报警开始时间',
    align:"center",
    dataIndex: 'alarmBeginTime'
   },
   {
    title: '报警结束时间',
    align:"center",
    dataIndex: 'alarmEndTime'
   },
   /*
   {
    title: '报警地址',
    align:"center",
    dataIndex: 'address'
   },
   */
   
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  /*
  {
    label: "学生姓名",
    field: 'studentName',
    component: 'Input',
    //colProps: {span: 6},
 },
	{
      label: "学生手机号",
      field: 'phone',
      component: 'Input',
      //colProps: {span: 6},
 	},
  */
	{
      label: "IMEI号",
      field: 'imei',
      component: 'Input',
      //colProps: {span: 6},
 	},
   {
    label: "报警时间",
    field: "accessDate",
    component: 'RangePicker',
    componentProps: {
        valueType: 'Date',
    },
  },
    
	{
      label: "报警类型",
      field: 'alarmType',
      component: 'JDictSelectTag',
      componentProps: {
        options: [
          { label: '低电量提醒', value: '1' },
          { label: '关机提醒', value: '2' },
          { label: 'SOS报警', value: '3' },
          { label: '进多边形围栏报警', value: '4' },
          { label: '出多边形围栏报警', value: '5' },
          { label: '进圆形围栏报警', value: '6' },
          { label: '出圆形围栏报警', value: '7' },
          { label: '体温正常提醒', value: '8' },
          { label: '体温异常报警', value: '9' }
        ],
      },
      //colProps: {span: 6},
 	}
];
//表单数据
export const formSchema: FormSchema[] = [
  
  {
    label: 'IMEI码',
    field: 'imei',
    required:true,
    component: 'Input'
  },
  {
    label: '学生手机号',
    field: 'bindingPhone',
    component: 'Input'
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

//表单数据
export const bindCardFormSchema: FormSchema[] = [
  {
    label: 'IMEI码',
    field: 'imei',
    required:true,
    component: 'Input'
  },
  {
    label: '学生',
    field: 'personId',
    component: 'JSelectPerson',
    componentProps:{
      isRadioSelection:true,
	    showButtom:false,
      params:{ignoreEsidCard:true}
    },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请选择要绑定的学生!'},
          ];
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
